/**
 * Created by zhao.gongwei on 2017/11/14.
 */
export default {
  bind(el,binding){
    var startTx, startTy,endTx,endTy,moveTx,moveTy;
    el.addEventListener('touchstart',function(e){
      var touch=e.touches[0];
      startTx = touch.clientX;
      startTy = touch.clientY;
    },false)
    el.addEventListener('touchend',function(e){
      var touch = e.changedTouches[0];
      endTx = touch.clientX;
      endTy = touch.clientY;
    },false)
    el.addEventListener('touchmove',function(e){
      var touch = e.changedTouches[0];
      moveTx = touch.clientX;
      moveTy =touch.clientY;
      el.style.left = moveTx-20+'px'
      el.style.top =moveTy-80+'px'
    },false)
    el.addEventListener('click',function(e){
      console.log('click事件')
    },false)

  }
}
